* Replication file for
* Rodolfo Disi Pavlic "The Nearness of Youth: Spatial and Temporal Effects of Protests on Political Attitudes in Chile" Latin American Politics and Society


* This files requires downloading LAPOP's AmericasBarometer Grand Merge 2004–2014 (Version 3.0 Free) dataset can be obtained from The AmericasBarometer by the Latin American Public Opinion Project (LAPOP), www.LapopSurveys.org
* to replicate these results: the following use-generated commands are needed: outreg2, grc1leg2
keep if pais==13
drop if year==2014 | year==2006
* merge with file containing protest number variables (7 days)
merge 1:1 year idnum using "/Users/RodolfoDisiPavlic/Dropbox/Replication files/LAPS/Protest Number 7.dta"
drop _merge
* merge with file containing protest number variables (14 days)
merge 1:1 year idnum using "/Users/RodolfoDisiPavlic/Dropbox/Replication files/LAPS/Protest Number 14.dta"
drop _merge
* merge with file containing protest number variables (28 days)
merge 1:1 year idnum using "/Users/RodolfoDisiPavlic/Dropbox/Replication files/LAPS/Protest Number 28.dta"
drop _merge
* merge with file containing protest number variables (56 days)
merge 1:1 year idnum using "/Users/RodolfoDisiPavlic/Dropbox/Replication files/LAPS/Protest Number 56.dta"
drop _merge
* merge with ID Commune and Date dataset
merge 1:1 year idnum using "/Users/RodolfoDisiPavlic/Dropbox/Replication files/LAPS/id commune and date.dta"
encode comuna, gen(commune)
drop _merge
* add commune level variables
merge m:1 comuna year using "//Users/RodolfoDisiPavlic/Dropbox/Replication files/LAPS/commune variables.dta", force
*drop cases made from commune/years without respondents
drop if _merge==2
* gen % of urban pop
gen purban=(urban*100)/tam
* use natural log of population size
gen comsize=tam/1000

* create number of protests variable (7)
gen protnum7=number_cases7
replace protnum7=0 if protnum7==.
replace protnum7=. if fecha==.b
* dummy7
gen pdummy7=.
replace pdummy7=1 if protnum7==1 |protnum7==2 |protnum7==3 |protnum7==4
replace pdummy7=0 if protnum7==0
* create number of protests variable (14)
gen protnum14=number_cases14
replace protnum14=0 if protnum14==.
replace protnum14=. if fecha==.b
* dummy14
gen pdummy14=.
replace pdummy14=1 if protnum14==1 |protnum14==2 |protnum14==3 |protnum14==4 |protnum14==5
replace pdummy14=0 if protnum14==0
* create number of protests variable (28)
gen protnum28=number_cases28
replace protnum28=0 if protnum28==.
replace protnum28=. if fecha==.b
* dummy28
gen pdummy28=.
replace pdummy28=1 if protnum28==1 |protnum28==2 |protnum28==3 |protnum28==4 |protnum28==5 |protnum28==6 |protnum28==7 
replace pdummy28=0 if protnum28==0
* create number of protests variable (56)
gen protnum56=number_cases56
replace protnum56=0 if protnum56==.
replace protnum56=. if fecha==.b
* dummy28
gen pdummy56=.
replace pdummy56=1 if protnum56==1 |protnum56==2 |protnum56==3 |protnum56==4 |protnum56==5 |protnum56==6 |protnum56==7 |protnum56==8 |protnum56==9 
replace pdummy56=0 if protnum56==0


* education main problem 
gen educ=0
replace educ=1 if a4==21
replace educ=. if a4==.a
replace educ=. if a4==.b
replace educ=. if a4==.c
* protests main problem
gen mob=0
replace mob=1 if a4==6
replace mob=. if a4==.a
replace mob=. if a4==.b
replace mob=. if a4==.c
* inequality main problem
gen ineq=0
replace ineq=1 if a4==6
replace ineq=. if a4==.a
replace ineq=. if a4==.b
replace ineq=. if a4==.c

* occupation: student 
gen estud=0
replace estud=1 if ocup4a==4
replace estud=. if ocup4a==.a
replace estud=. if ocup4a==.b
replace estud=. if ocup4a==.z
* years of schooling
tab ed
* Children
gen hijos=1
replace hijos=0 if q12==0
replace hijos=. if q12==.a
replace hijos=. if q12==.b
* Age
gen edad=q2
* Gender (male)
gen male=q1
*retrospective economic evaluation
gen econ=soct2

* interest in politics
gen interest=5-pol1
* presidential approval
gen approve=6-m1
* preference for democracy (based on dem2)
gen dem=.
replace dem=0 if dem2==3
replace dem=1 if dem2==1
replace dem=2 if dem2==2

gen conversation=5-pol2

svyset weight1500

* dependent variables (not recoded)
* interest in politics: pol1
* approval of government opponents' right to peacefully protest: d2
* external political efficacy: eff1 
* internal political efficacy eff2 
* trust in president: b21a
* support for democracy: ing4
* support for occupations: e14
* support for blockades: e15
* national pride: b43

* Descriptive statistics (DVs by values of the IV)
* education
tab protnum7 educ, row
tab protnum14 educ, row
tab protnum28 educ, row
tab protnum56 educ, row


* regressions
* weak attitudes
* education
logit educ c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500], or vce(cluster comuna)
outreg2 using weak.xls, replace ctitle(educ 1 week) eform alpha(0.001, 0.01, 0.05)
logit educ c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(educ 2 weeks) eform alpha(0.001, 0.01, 0.05)
logit educ c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(educ 4 weeks) eform alpha(0.001, 0.01, 0.05)
logit educ c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(educ 8 weeks) eform alpha(0.001, 0.01, 0.05)
* approve peaceful demonstrations by government critics (d2)
ologit d2 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(d2 1 week) eform alpha(0.001, 0.01, 0.05)
ologit d2 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(d2 2 weeks) eform alpha(0.001, 0.01, 0.05)
ologit d2 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(d2 4 weeks) eform alpha(0.001, 0.01, 0.05)
ologit d2 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(d2 8 weeks) eform alpha(0.001, 0.01, 0.05)
* support of legal demonstrations (e5)
ologit e5 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e5 1 week) eform alpha(0.001, 0.01, 0.05)
ologit e5 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e5 2 weeks) eform alpha(0.001, 0.01, 0.05)
ologit e5 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e5 4 weeks) eform alpha(0.001, 0.01, 0.05)
ologit e5 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e5 8 weeks) eform alpha(0.001, 0.01, 0.05)
* support for occupations (e14)
ologit e14 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e14 1 week) eform alpha(0.001, 0.01, 0.05)
ologit e14 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e14 2 weeks) eform alpha(0.001, 0.01, 0.05)
ologit e14 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e14 4 weeks) eform alpha(0.001, 0.01, 0.05)
ologit e14 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e14 8 weeks) eform alpha(0.001, 0.01, 0.05)
* support for blockades (e15)
ologit e15 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e15 1 week) eform alpha(0.001, 0.01, 0.05)
ologit e15 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e15 2 weeks) eform alpha(0.001, 0.01, 0.05)
ologit e15 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e15 4 weeks) eform alpha(0.001, 0.01, 0.05)
ologit e15 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(e15 8 weeks) eform alpha(0.001, 0.01, 0.05)
* presidential approval (approve)
ologit e15 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(approve 1 week) eform alpha(0.001, 0.01, 0.05)
ologit e15 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(approve 2 weeks) eform alpha(0.001, 0.01, 0.05)
ologit e15 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(approve 4 weeks) eform alpha(0.001, 0.01, 0.05)
ologit e15 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(approve 8 weeks) eform alpha(0.001, 0.01, 0.05)
* trust in president (b21a)
ologit b21a c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(b21a 1 week) eform alpha(0.001, 0.01, 0.05)
ologit b21a c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(b21a 2 weeks) eform alpha(0.001, 0.01, 0.05)
ologit b21a c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(b21a 4 weeks) eform alpha(0.001, 0.01, 0.05)
ologit b21a c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] ,or vce(cluster comuna)
outreg2 using weak.xls, append ctitle(b21a 8 weeks) eform alpha(0.001, 0.01, 0.05)


* strong attitudes
* political interest (interest)
ologit interest c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500], or vce(cluster comuna)
outreg2 using strong.xls, replace ctitle(interest 1 week) eform alpha(0.001, 0.01, 0.05)
ologit interest c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500], or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(interest 2 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit interest c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500], or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(interest 4 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit interest c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500], or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(interest 8 weeks) eform alpha(0.001, 0.01, 0.05)
* external efficacy (eff1)
ologit eff1 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(eff1 1 week) eform alpha(0.001, 0.01, 0.05)
ologit eff1 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(eff1 2 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit eff1 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(eff1 4 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit eff1 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(eff1 8 weeks) eform alpha(0.001, 0.01, 0.05)
* internal efficacy (eff2)
ologit eff2 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(eff2 1 week) eform alpha(0.001, 0.01, 0.05)
ologit eff2 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(eff2 2 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit eff2 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(eff2 4 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit eff2 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(eff2 8 weeks) eform alpha(0.001, 0.01, 0.05)
* support for democracy (ing4)
ologit ing4 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(ing4 1 week) eform alpha(0.001, 0.01, 0.05)
ologit ing4 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(ing4 2 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit ing4 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500], or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(ing4 4 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit ing4 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(ing4 8 weeks) eform alpha(0.001, 0.01, 0.05)
* perception of democracy (dem)
ologit dem c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(dem 1 week) eform alpha(0.001, 0.01, 0.05)
ologit dem c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(dem 2 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit dem c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(dem 4 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit dem c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(dem 8 weeks) eform alpha(0.001, 0.01, 0.05)
* national pride (b43)
ologit b43 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b43 1 week) eform alpha(0.001, 0.01, 0.05)
ologit b43 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b43 2 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit b43 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b43 4 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit b43 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b43 8 weeks) eform alpha(0.001, 0.01, 0.05)
* Respect for political institutions (b2)
ologit b2 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b2 1 week) eform alpha(0.001, 0.01, 0.05)
ologit b2 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b2 2 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit b2 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b2 4 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit b2 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b2 8 weeks) eform alpha(0.001, 0.01, 0.05)
* system support (b6)
ologit b6 c.protnum7 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b6 1 week) eform alpha(0.001, 0.01, 0.05)
ologit b6 c.protnum14 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b6 2 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit b6 c.protnum28 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b6 4 weeks) eform  alpha(0.001, 0.01, 0.05)
ologit b6 c.protnum56 i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
outreg2 using strong.xls, append ctitle(b6 8 weeks) eform alpha(0.001, 0.01, 0.05)

* Endogeneity (protest#year interactions for models where protnum variables where significant)

* weak attitudes
* support right to demonstrate peacefully (protnum7)
ologit d2 c.protnum7##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500] , or vce(cluster comuna)
testparm c.protnum7#i.year
outreg2 using interactions.xls, replace ctitle(d2 1 week) eform alpha(0.001, 0.01, 0.05)  
* interaction is not significant
* support right to demonstrate peacefully (protnum14)
ologit d2 c.protnum14##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500] , or vce(cluster comuna)
testparm c.protnum14#i.year
* not significant
* support right to demonstrate peacefully (protnum56)
ologit d2 c.protnum28##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500] , or vce(cluster comuna)
testparm c.protnum28#i.year
* not significant
* support right to demonstrate peacefully (protnum56)
ologit d2 c.protnum56##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500] , or vce(cluster comuna)
testparm c.protnum56#i.year
* interaction is not  significant, Prob > chi2 = 0.0589

* strong attitudes
* interest (protnum7)
ologit interest c.protnum7##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500], or vce(cluster comuna)
testparm c.protnum7#i.year
* interaction is statistically significant
outreg2 using interactions.xls, append ctitle(interest 1 week) eform alpha(0.001, 0.01, 0.05)  

* external efficacy (protnum14)
ologit eff1 c.protnum14##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500], or vce(cluster comuna)
testparm c.protnum14#i.year
* interaction significant
outreg2 using interactions.xls, append ctitle(eff1 2 weeks) eform alpha(0.001, 0.01, 0.05)

* respect for political institutions (protnum14)  
ologit b2 c.protnum14##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500] , or vce(cluster comuna)
testparm c.protnum14#i.year
outreg2 using interactions.xls, append ctitle(b2 2 weeks) eform alpha(0.001, 0.01, 0.05)


* Postestimation
* graph for each attitude one significant protnum*year interaction

* support right to demonstrate peacefully (protnum56)
ologit d2 c.protnum7##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500], or vce(cluster comuna)
margins year, predict(outcome(10)) at(protnum=(0 1 2 3 4)) atmeans post
marginsplot
* save graph as "d27.gph"

* strong attitudes
* interest (protnum7)
meologit interest c.protnum7##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500], or vce(cluster comuna)
margins year, predict(outcome(4)) at(protnum=(0 1 2 3 4)) atmeans post saving(int7, replace)
marginsplot
* save graph as "int7.gph"

* external efficacy (protnum14)
meologit eff1 c.protnum14##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban [pw=weight1500], or vce(cluster comuna)
margins year, predict(outcome(7)) at(protnum=(0 1 2 3 4 5)) atmeans post saving(eff114, replace)
marginsplot
* save graph as "eff114.gph"

* respect for political institutions (protnum14)  
ologit b2 c.protnum14##i.year i.econ c.ed i.estud i.hijos c.edad i.male c.pob c.comsize c.purban[pw=weight1500], or vce(cluster comuna)
margins year, predict(outcome(7)) at(protnum=(0 1 2 3 4 5)) atmeans post saving(b214, replace)
marginsplot
* save graph as "b214.gph"

* Finally, use the following command to graph to combine the  graphs:
* grc1leg2  "int7.gph" "eff114.gph" "b214.gph"






